<%-- 
    Document   : pengarangAdd
    Created on : Feb 22, 2015, 3:16:25 PM
    Author     : Kim
--%>

<%@ include file="/common/header.jsp"%>

<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Master Pengarang</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Form Pengarang
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-12">
                            <form:form id="saveForm" name="saveForm" method="post" modelAttribute="pengarang" enctype="multipart/form-data">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">Kode Pengarang</label>
                                    <input class="form-horizontal" type="text" id="kodePengarang" name="kodePengarang"
                                           <c:if test="${not empty pengarang}">value="<c:out value='${pengarang.kodePengarang}' />" readonly="true"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Nama Pengarang</label>
                                        <input class="form-horizontal" type="text" id="namaPengarang" name="namaPengarang"
                                        <c:if test="${not empty pengarang}">value="<c:out value='${pengarang.namaPengarang}' />"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Gender Pengarang</label>
                                        <select class="form-horizontal" name="genderPengarang">
                                            <option value="Pria" <c:if test="${pengarang.genderPengarang == 'Pria'}">selected="yes"</c:if>> Pria </option>
                                            <option value="Wanita" <c:if test="${pengarang.genderPengarang == 'Wanita'}">selected="yes"</c:if>> Wanita </option>
                                        </select>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Tanggal Ultah</label>
                                        <input class="form-horizontal" type="text" id="tanggalUltah" name="tanggalUltah" placeholder="dd/MM/yyyy"
                                        <c:if test="${not empty pengarang}">value="<fmt:formatDate value='${pengarang.tanggalUltah}' pattern="dd/MM/yyyy" />"</c:if> />
                                    </div>
                                    
                                     <div class="form-group">
                                        <label class="col-sm-2 control-label">Tempat Lahir</label>
                                        <input class="form-horizontal" type="text" id="tempatLahir" name="tempatLahir"
                                        <c:if test="${not empty pengarang}">value="<c:out value='${pengarang.tempatLahir}' />"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Photo</label>
                                        <input class="form-horizontal" type="file" id="fileGambar" name="fileGambar" />
                                    </div>

                                    <div class="form-group" >
                                        <div class="col-sm-offset-2 col-sm-6" style="padding-top: 10px">
                                        <c:if test="${empty pengarang}">
                                            <input type="button" value=" Simpan " class="btn btn-primary" onclick="functionSave('<c:url value="/page/pengarangAdd.html" />');" />
                                        </c:if>
                                        <c:if test="${not empty pengarang}">
                                            <input type="button" value=" Simpan " class="btn btn-primary" onclick="functionSave('<c:url value="/page/pengarangUpdate.html" />');" />
                                            
                                        </c:if>
                                        <input type="button" value=" Batal " class="btn btn-default" onclick="backList('<c:url value="/page/pengarangView.html" />');" /> 
                                    </div>
                                </div>
                            </form:form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%@ include file="/common/footer.jsp"%>